package com.kun.companion.util;

import com.kun.companion.core.context.DestroyingBean;
import com.kun.companion.core.context.InitializingBean;
import com.kun.companion.core.context.annotation.Autowired;
import com.kun.companion.core.context.annotation.Component;
import com.kun.companion.core.context.annotation.PostConstruct;

/**
 * TODO
 *
 * @author gzc
 * @since 2025/1/27 4:22
 **/
@Component
public class ServiceA implements DestroyingBean, InitializingBean {
    @Autowired
    private ServiceB serviceB;

    @PostConstruct
    public void hhh() {
        System.out.println("调用@PostConstruct方法");
    }

    @Override
    public void destroy() {
        System.out.println("调用destroy方法");

    }

    @Override
    public void init() throws Exception {
        System.out.println("调用init方法");
        System.out.println("serviceB ->" + serviceB);
    }
}
